package hu.jonas.junitmax;

import org.eclipse.jdt.junit.model.ITestCaseElement;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;

public class TestResultSorter extends ViewerSorter {

	@Override
	public int compare(Viewer viewer, Object e1, Object e2) {
		ITestCaseElement t1 = (ITestCaseElement) e1;
		ITestCaseElement t2 = (ITestCaseElement) e2;
		
		return -Double.compare(t1.getElapsedTimeInSeconds(), t2.getElapsedTimeInSeconds());
	}

}
